package com.boyaa.shells.tool 
{
	import com.boyaa.shells.data.GiftDataList;
	import com.boyaa.shells.data.GoodsList;
	import com.boyaa.shells.data.model.GiftData;
	import com.boyaa.shells.data.model.GoodsData;
	import com.boyaa.shells.data.model.ShopData;
	import com.boyaa.shells.data.ShopDataList;
	import com.boyaa.shells.lang.LangManager;
	/**
	 * ...
	 * @author coco
	 */
	public class ChangeGoodsDiscription
	{
		
		private static var _instance:ChangeGoodsDiscription = null;
		
		private var discription:String = null;
		
		public function ChangeGoodsDiscription(s:Single) 
		{
			
		}
		public function changeGiftDis(data:ShopData):void
		{
			
			data.dec = "";
			//var best:int = 
			if (data.best < (GiftDataList.instance.list[GiftDataList.instance.list.length - 1] as GiftData).mlevel)
			{
				while (!GiftDataList.instance.getGiftData(++data.best))
				{
					
				}
			}
			else
				GoodsList.instance.removeGoodsByOnlyID((data as GoodsData).onlyID);
				
			var giftdata:GiftData = GiftDataList.instance.getGiftData(data.best);
			
			data.dec = LangManager.getLang.getreplaceLang("nhwp", data.dec);
			
			var length:int = giftdata.giftarr.length;
			for (var i:int = 0; i < length; i++ )
			{
				var _data:ShopData = ShopDataList.instance.getSingleData(giftdata.giftarr[i].pcate, giftdata.giftarr[i].pframe);	//获取商店物品的描述信息			
				data.dec = data.dec + " " + _data.name;
				_data = null;
			}
			data.dec = LangManager.getLang.getreplaceLang("dklbxyjb", data.dec, giftdata.mlevel);
		}
		
		public static function get instance():ChangeGoodsDiscription
		{
			if (!_instance)
				_instance = new ChangeGoodsDiscription(new Single());
			return _instance;
		}
	}

}
class Single{}